import type { GreasyForkElements } from '../../../../../../../../types/constants/personalization/greasy_fork'
import { ThemeVarService } from '../../../../../../../../lib/abstract/style/theme_var/service'
import {
  PAGE_ELEMENTS,
  SUPPORTED_PLATFORMS,
} from '../../../../../../../../types/constants'

export class BianCommonPage {
  elements: GreasyForkElements = PAGE_ELEMENTS[SUPPORTED_PLATFORMS.BIAN]
  private static instance: BianCommonPage
  private readonly themeVarService: ThemeVarService = ThemeVarService.getInstance()

  /**
   * 获取单例实例
   */
  public static getInstance(): BianCommonPage {
    if (!BianCommonPage.instance) {
      BianCommonPage.instance = new BianCommonPage()
    }
    return BianCommonPage.instance
  }

  init(): void {}

  getMainStyles(): string {
    return `
/* 面包屑 */
.wrap {
  #main {
    .loaction {
      a {
        color: var(${this.themeVarService.link.default.text}) !important;
        
        &:hover {
          color: var(${this.themeVarService.link.default.textHover}) !important;
        }
      }
    }
  }
}

/* 页脚 */    
#footer {
  background-color: var(${this.themeVarService.default.background.base}) !important;
  color: var(${this.themeVarService.default.text.secondary}) !important;
  border-top: none !important;
  
  a {
    color: var(${this.themeVarService.link.default.text}) !important;
    
    &:hover {
      color: var(${this.themeVarService.link.default.textHover}) !important;
    }
  }
}
`
  }
}
